package com.adminx.controller.admin;

import org.apache.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * @Description: 登录判断
 */
@Controller
public class LoginController {

	protected static Logger logger = Logger.getLogger("controller");

	/** 
	 * 指向登录页面
	 */
	@RequestMapping(value = "/login", method = RequestMethod.GET)
	public String getLoginPage(String error, ModelMap model) {
		model.put("error", error);
		return "admin/login";
	}
	
	/** 
	 * LoginSuccessHandle验证通过后进入
	 */
	@RequestMapping(value = "/index", method = RequestMethod.GET)
	public String getIndexPage() {
		return "admin/index";
	}
	
	/**
	 * 指定无访问额权限页面 
	 *
	 * @return
	 */
	@RequestMapping(value = "/denied", method = RequestMethod.GET)
	public String getDeniedPage() {
		return "login";
	}
}
